package com.bugpool.leilema.product.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bugpool.leilema.product.entity.ProductInfo;
import com.bugpool.leilema.product.mapper.ProductInfoMapper;
import com.bugpool.leilema.product.service.ProductInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author bugpool
 * @since 2020-04-14
 */
@Service
public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, ProductInfo> implements ProductInfoService {

    @Autowired
    ProductInfoMapper productInfoMapper;

    @Override
    @Cacheable(value = "redis", key = "#root.targetClass + '::' + #root.methodName + '::' + #productName")
    public List getByLikeName(String productName) {
        return productInfoMapper.getByLikeName(productName);
    }

}
